package com.coco.user.service.impl;

import com.coco.user.mapper.ShippingAddressMapper;
import com.coco.user.pojo.TbShippingAddress;
import com.coco.user.service.ShippingAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShippingAddressServiceImpl implements ShippingAddressService {

    @Autowired
    private ShippingAddressMapper shippingAddressMapper;

    /**
     * 查询所有用户地址信息
     *
     * @return shippingAddressList
     * @author hu
     * @date 2021/7/21 20:53
     */
    @Override
    public List<TbShippingAddress> shippingAddressList() {
        return shippingAddressMapper.shippingAddressList();
    }

    /**
     * 添加地址信息
     *
     * @param shippingAddress
     * @return
     * @author hu
     * @date 2021/7/21 20:53
     */
    @Override
    public void add(TbShippingAddress shippingAddress) {

        shippingAddressMapper.add(shippingAddress);
    }

    /**
     * 修改地址信息
     *
     * @param shippingAddress
     * @return
     * @author hu
     * @date 2021/7/21 20:53
     */
    @Override
    public void update(TbShippingAddress shippingAddress) {
        shippingAddressMapper.update(shippingAddress);
    }

    /**
     * 删除用户地址信息
     *
     * @param id
     * @return
     * @author hu
     * @date 2021/7/21 20:53
     */
    @Override
    public void deleteById(Long id) {
        shippingAddressMapper.deleteById(id);
    }

    /**
     * 查询一条用户地址信息
     * @param id
     * @return
     * @author hu
     * @date 2021/7/21 20:53
     */
    @Override
    public TbShippingAddress findOne(Long id) {
        return shippingAddressMapper.findOne(id);
    }


}
